<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends CI_Controller {

    protected $data = array();

    protected $module = 'default';

    protected $header_data = array();

    public function __construct()
    {
        parent::__construct();
        $this->load->helper('url');
        $this->header_data['title'] = 'Welcome'; //标题
        $this->header_data['active'] = 'welcome'; //菜单锁定
        $this->header_data['open'] = false; //二级目录
    }

    /**
     * 加载内部样式
     */
    public function display($template, $data = array())
    {
        $this->load_header();
        $this->load->view($this->module.'/'.$template, $data);
        $this->load_footer();
    }

    /**
     * 加载头部
     *
     */
    private function load_header()
    {
        $this->load->view($this->module.'/'.'header', $this->header_data);
    }

    /**
     * 加载尾部
     *
     */
    private function load_footer()
    {
        $this->load->view($this->module.'/'.'footer');
    }

}